package com.javatest.springbootvalidate.entities;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class Order {
    @NotNull(message = "date can't be null")
    private Date date;

    @NotNull(message = "price can't be null")
    @DecimalMin(value = "0", inclusive = false, message = "price can't be less than 0")
    private BigDecimal price;
}
